// 				YOU'RE NOT LIKE US! ETHNIC DISCRIMINATION AND NATIONAL BELONGING IN NIGERIA

												*Daniel Tuki*
									
									
* This study is based on data from Rounds 7 & 8 of the Afrobarometer survey, conducted in Nigeria in 2017 and 2020, respectively. To access the dataset and survey questionnaire visit: https://www.afrobarometer.org/

** The codes below are used to replicate the statistical result in the article. First load the data file named "Pooled_data"



//											DESCRIPTIVE RESULTS

// Figure 2: Ethnic distribution of national versus ethnic identification in Nigeria

* National: 
tab nat_identity

* Igbo: 
tab nat_identity if igbo == 1

* Yoruba:
tab nat_identity if yoruba == 1

* Hausa/Fulani:
tab nat_identity if hausa_fulani == 1

* Ethnic minorities: 
tab nat_identity if minority == 1



// Figure 3: Ethnic distribution of discrimination experience among Nigerians

* National:
tab discrimination 

* Igbo: 
tab discrimination if igbo == 1

* Yoruba: 
tab discrimination if yoruba == 1

* Hausa/Fulani
tab discrimination if hausa_fulani == 1

* Ethnic minorities:
tab discrimination if minority == 1



//	Table 1: Descriptive statistics

summ nat_identity bin_eth_dis hausa igbo yoruba minority no_educ pri_educ sec_educ tertiary relig gender age




//											REGRESSION RESULTS


//	 Table 2: Ordered logit models regressing national vs. ethnic identification on ethnicity in Nigeria

* Model 1: Baseline model
ologit nat_identity bin_eth_dis i.year, vce(robust)
*To obtain the AIC statistic: 
estat ic

* Model 2: Adding control variables only
ologit nat_identity bin_eth_dis pri_educ sec_educ tertiary relig gender age i.year, vce(robust)
*To obtain the AIC statistic: 
estat ic

* Model 3: Adding dummies for the major ethnic categories
ologit nat_identity bin_eth_dis igbo yoruba hausa_fulani pri_educ sec_educ tertiary relig gender age i.year, vce(robust)
*To obtain the AIC statistic: 
estat ic

* Model 4: Adding interaction term for Igbo ethnicity and discrimination
ologit nat_identity i.bin_eth_dis##i.igbo i.bin_eth_dis##i.yoruba i.bin_eth_dis##i.hausa_fulani pri_educ sec_educ tertiary relig gender age i.year, vce(robust)
*To obtain the AIC statistic: 
estat ic



//	Figure 4: Predicted probabilities of the association between Igbo ethnicity and national versus ethnic identification in Nigeria 

** The figure is based on Model 4 in Table 2: 

ologit nat_identity i.bin_eth_dis##i.igbo i.bin_eth_dis##i.yoruba i.bin_eth_dis##i.hausa_fulani pri_educ sec_educ tertiary relig gender age i.year, vce(robust)
*To obtain the marginal effects for religion
margins, dydx(igbo)
*To plot the marginal effects as a bar chart with confidence intervals
marginsplot, recast(bar) yline(0) name (igbo_direct, replace)
			
				
				
//	Figure 5: Predicted probabilities of identification by discrimination status among the Igbo

** The figures are also based on Model 4 in Table 2: 

* Panel A: Ethnicity only
margins bin_eth_dis, at(igbo=1 hausa_fulani=0 yoruba=0) predict(outcome(1))
marginsplot, x(bin_eth_dis) name (discrim_thnic_only, replace)

* Panel B: Nationality only
margins bin_eth_dis, at(igbo=1 hausa_fulani=0 yoruba=0) predict(outcome(5))
marginsplot, x(bin_eth_dis)	name (discrim_nat_only, replace)
				
// To combine Panels A & B: 
graph combine discrim_thnic_only discrim_nat_only
			
				
		
				
// 												APPENDIX

//	Figure A1: Predicted probabilities of identification by discrimination status among the Igbo II

** The figures are based on Model 4 in Table 2: 
ologit nat_identity i.bin_eth_dis##i.igbo i.bin_eth_dis##i.yoruba i.bin_eth_dis##i.hausa_fulani pri_educ sec_educ tertiary relig gender age i.year, vce(robust)

* Panel A: Ethnicity > nationality
margins bin_eth_dis, at(igbo=1 hausa_fulani=0 yoruba=0) predict(outcome(2))
marginsplot, x(bin_eth_dis) name (discrim_eth_over_nat, replace)

* Panel B: Ethnicity = Nationality
margins bin_eth_dis, at(igbo=1 hausa_fulani=0 yoruba=0) predict(outcome(3))
marginsplot, x(bin_eth_dis)	name (discrim_eth_equal_nat, replace)

* Panel C: Nationality > Ethnicity
margins bin_eth_dis, at(igbo=1 hausa_fulani=0 yoruba=0) predict(outcome(4))
marginsplot, x(bin_eth_dis)	name (discrim_nat_over_eth, replace)			


// To combine Panels A, B and C 
graph combine discrim_eth_over_nat discrim_eth_equal_nat discrim_nat_over_eth


